JForth Reference Manual
Table of Contents

Forth Reference

1) Installation and Startup
Make Backup Copies	1
Installing JForth on a Hard Disk	2
Running JForth from Floppies using the Shell.	2
Running JForth from Floppies using the Workbench	3
Tips for Running With Only 512K	3
Reboot	3
Do NOT Load the Workbench, use the Shell	3
Reduce the Size of JForth	4
Running JForth with only 1 Disk Drive	4

2) Introduction to JForth
Major Functional Systems	1
Grand Tour of JForth	3
JForth Compared to other Forths	6

3) JForth Disk Organization
Directory Nicknames	1
CL:  -  Extras:Clone  -  Clone Recompiler	1
COM:  -  Extras:Com  -  Executable Command Images	1
FD:  -  JForth:fd.files	2
JA:  -  Extras:Appls   -   Applications	2
JARP:  -  JTools:JARP  -  ARP Interface	2
JD:  -  Extras:Demos	2
JDEV:  -  JTools:DevTools  -  Development Tools	3
JF:  -  Extras:Sysgen  -  System Generation	4
JFLT:  -  Extras:Floats  -  Floating Point	5
JI:  -  JForth:Include	5
JIFF:  -  Extras:IFF  -  Interchange File Format	5
JO:  -  Extras:ODE  -  Object Development Environment	5
JPICS:  -  JTools:JPics   - Pictures for tutorials	6
JRX:  -  JTools:JARexx  -  Arexx Interface	6
JTX:  -  JTools:Textra_Dir  -  Text Editor	6
JU:  -  JForth:Util  -  Utilities	6
General Forth Utilities	6
Amiga Specific Utilities	7

4) Beginning Forth Tutorial
Forth Syntax	1
The Stack	1
Arithmetic	4
Defining a New Word	5
More Arithmetic	5
Arithmetic Overflow	6
Character Input and Output	6
Answers to Problems	8

5) Intermediate Forth Tutorial
Editing Programs in Files	1
Sample Program	1
INCLUDE the Program	2
Variables	3
Constants	4
Logical Operators	5
Flow of Control	6
Loops	7
Text I/O	9
Changing Numeric Base	10
Answers to Problems	11

6) Advanced Forth Tutorial
String Handling	1
Saving Forth	2
Programming Aids	3
The Forth Interpreter and Dictionary	3
Return Stack	5
Extending the Compiler	6

7) Clone - The JForth Target Compiler
How To Use Clone	1
Technical Information About Clone	2
Clone Glossary	2
Customizing the CLONEd Image	3
Clone Configuration File	5
Word Redefinitions under Clone	6
How To Be Clone Compatible	6
Differences Between Original and Cloned Code	8

8) File I/O
File I/O Tutorial	1
Creating a Text File	1
Reading a Text File	2
Using Binary Data Files	2
File I/O Reference	4
Opening Files	4
Reading and Writing to files.	5
Closing Files.	5
Building AmigaDOS Filenames.	6
Sequential Virtual File Utilities	7
DOLINES - Easy Text File Processing	8

9) Floating Point Arithmetic
Floating Point Tutorial	1
Simple Arithmetic and Output	1
Transcendental Functions	2
Precision Independent Style	2
Cloning Floating Point Code	2
Floating Point Glossary	3
Floating Point Control	3
Arithmetic Operators	3
Result Flags	3
Transcendental Functions	4
Logical Operators	5
Stack Operators	5
Number Storage	6
Number Conversion Operators	6
Display Operators	6
Display Operators & Variables	6
Number Interpreters	7

10) Object-Oriented Development Environment (ODE)
Philosophy	1
Existing Classes in ODE	1
Hidden Data	1
Generic Messages	2
Tradeoffs	2
Origins of OOP	2
Terminology	2
Turorial 1 - Creating and Using Objects	3
Including ODE	3
Creating an Object, Instantiation	3
Sending Messages	3
Using Arrays	3
Finding an item in an Array	4
Range Checking	4
Freeing Memory in Array Classes	5
}STUFF: and FILL:	5
Tutorial 2 - Early versus Late Binding	5
To Whom It May Concern,	5
Local Variables and Late Binding	6
Tutorial 3 - Using OB.ELMNTS	6
Predefined Classes	8
OBJECT	8
OB.INT - subclass of OBJECT	8
OB.BARRAY - subclass of OBJECT	9
Example of Using Arrays	10
OB.ARRAY	10
Example of Execution Array	11
OB.ELMNTS	11
OB.LIST	14
OB.OBJLIST	14
Dynamic Instantiation using OB.OBJLIST	15
Defining New Classes and Methods	16
Class Definition Glossary	16
Instance Variables	17
Using SELF in Method Definitions	17
Using SUPER and SUPER-DOOPER  in Method Definitions	18
Special Methods:  INIT:	19
Example Class Definition	19
Example of Creating a Class with Instance Objects	20
Advanced Topics	21
ODE Functions	21
Getting Information About Classes	21
Dynamically Allocated Objects	22
Examining Instance Variables	22
Error Reporting	23
Inheritance	23
Memory Placement for Amiga	23
Cloning ODE Programs using JForth	23
Explanation of ODE Structures Diagram	24

11) Miscellaneous Forth Tools
Memory Allocation	1
Use Memory like a Stack.	2
Deferred Words	3
Using DEFER to "vector" code.	3
Deferred System Words	3
Potential Problems with Defer	4
Tools for FORGET	5
Local Variables	6
Logging to Files or the Printer	8
Word Usage Analysis	9
Error Handling	9
The dreaded GOTO	9

12) System Internals
USER Variable Data Area	1
Data Stack Area	2
Extensible Dictionary Area	2
Other memory Allocation / Utilization...	4
Relocations Table	5
Files and Memory Housekeeping...	5
JForth Compiler	5
How to Generate a New JForth System	6

Development Tools

13) Debugging
Tools Overview	1
Debugging Hints	2
Source Level Debugger Tutorial	3
Compiling with DEBUG{	3
Examining Code	3
Stopping with a Breakpoint	4
Stopping with Control-D	5
Debugging a Large Program	5
Debugging a Cloned Program	5
IMMEDIATE Words	6
Source Level Debugger Glossary	6
Debugger One Key Commands	7

14) 68000 Assembly
JForth  and 68000 Assembly Language	1
JForth Register Utilization	1
JForth 68000 Forth Style Assembler   (RPN)	2
Motorola-Style (Forward-Parsing) Assembler	6
Compiling the Forward Assembler	6
The Forward Assembler Label Field	7
The Forward Assembler Opcode Field	7
The Forward Assembler Operand Field	8
Example of Accessing Structure Members	8
Example of Referencing Variables from an Interrupt	9
The Forward Assembler as a MODULE	9
DISM - JForth Disassembler	9
Compiling the Disassembler	9
Disassembler Output	10
"Automatic" Disassembly Features	10
Disassembling within the JForth Image	11
Disassembling outside of the JForth Image	11
The Disassembler as a MODULE	11

15) Forth BLOCK Environment
AmigaDOS Incompatibilities	1
JForth supplied SCREEN utilities	1
Line Editor Operation and Glossary	2
SCRED ... the JForth SCReen EDitor	3
BLOCK2TEXT	4

16) Precompiled Modules
Modules and SAVE-FORTH	1
Technical Notes on Modules	1
Using the Assembler and Disassembler Modules	2
Using other Modules	2
Files in INCLUDES Module	3
Creating a Custom Module	3

17) Miscellaneous Development Tools
Command Line History	1
Using the Cursor Keys	1
Vocabularies	3
SHOWHUNKS - for Analyzing Amiga Binary Files	5
JForth Optimizing Compiler Extension	6
PROFILE - Performance Analyser	7

Amiga Interface

18) Amiga Libraries and Structures
Amiga Libraries - Tutorial	1
Passing Addresses to Library Routines	2
Getting Values from Library Routines	2
Accessing the Amiga Libraries  - Reference	3
Opening Libraries	3
Closing Libraries.	4
Calling Amiga Libraries.	4
Library Open Verification	5
CALL modifiers	5
CALL shortcuts	5
Adding Libraries.	6
Amiga 'C' Structure Interface	7
Structures in the Amiga	7
Loading Structure Definitions from ".j" Files	7
Loading Structure Definitions from Precompiled Modules	7
Using Structures	8
Making an Array of Structures	8
Referencing Substructures	8
Accessing Array Members in Structures	9
Examining Structures with DST	9
Defining Your Own Structures	9
Structure Glossary	10
Structure Accessing Words	10
Structure Defining Words	11
Member UNIONs	12
Addressing Considerations - Important!!!	13
H2J - Convert "xx.h" to "xx.j"	14

19) Graphics Toolkit
Graphics Tutorial	1
Generic Graphics Glossary	3
Control Routines	3
Output Primitives	4
Output Attributes	5
Graphics Input	6
Event Driven Programming.	6
Routines in JU:AMIGA_EVENTS - EV.xxxx	6

20) EZMenu System
Tutorial	1
EZMenu Structure	1
AMENU Program	1
EZMenu Glossary	4
EZMenu Default Settings	6
Low Level Menu Support	6

21) IFF Support
Description of Files in JIFF:	1
Tutorial 1 - Displaying Pictures	1
Tutorial 2 - The Picture System	2
Drawing a Portion of a Picture	2
Special Effects - Wipes and Fades	3
Moving a Brush, Restoring the Background	4
Cleaning Up	5
Picture System Reference	5
Error Handling	5
Double Buffering	5
Using your Own Display Screen	6
Clipping with Pictures	6
Picture Glossary	6
JIFF:PICTURE	6
JIFF:PIC_EFFECTS	9
JIFF:PIC_FLIP 	9
IFF File Support	9
How JForth Handles IFF files	10
Tutorial 3 - Vectored Parsing of IFF Files	10
Printing Chunk Headers	10
Parsing ILBM FORMs	11
IFF Support Glossary	11
JIFF:ILBM_PARSER	11
JIFF:ILBM_MAKER	12
JIFF:SHOW_IFF	13
Low Level Support	14
JIFF:IFF_SUPPORT	14
JIFF:UNPACKING	15
JIFF:PACKING	15
JIFF:PACKING_OLD	16
Incompatibilities with JForth V2.0	16

22) Anims and Animbrushes
ANIM Formats	1
Compiling the ANIM Toolbox	2
Tutorial 1 - Displaying an ANIM File	2
Tutorial 2 - ANIM Control and Disk Based ANIMS	3
Tutorial 3 - ANIMBRUSHES	4
Animation Tips	5
ANIM Support Glossary	6
ANIM IFF tools	6
ANIMATION Words	7
ANIMBRUSH Words	8
CONVERSION Words	9
LOW LEVEL support words	10

23) ARexx Support
What is ARexx?	1
Description of Files	1
Low Level ARexx Support	2
ARexx Toolbox Tutorial	2
ARexx Toolbox Glossary	5
Integrating Textra and JForth	7
ARexx Variables Interface	8
Variable Names	8
The RVI Glossary	8
RVI Code Examples and Test Program	9
RexxView	10

24) Miscellaneous Amiga Support
What is supported and why?	1
File JU:GRAPH_SUPPORT	1
Font Support	3
File JU:GADGET_SUPPORT	3
File JU:POLYGON for Area Fill	4
File JU:SCREEN_SUPPORT	4
Exec Library Support	5
Other Exec words - CreatePort() AbortIO() etc.	6
Amiga Linked List Tools	6
ANSI Text and Cursor Control	7
Amiga DOS 2.0 Support	8
Identifying the Workbench Version	8
JU:ASL_SUPPORT	8
ASL Forth Utilities	9
Tag Lists	9

Glossary
Key to Glossary - Stack Diagrams

Appendices
A) Delta Research Biographies	1

B) Resources	2
On-Line	2
Organizations	2
Publications	3

C) ASCII Control Characters	4

D) Sample Applications	5
CR2LF.f - Carriage Return to Line Feed	5
DIAL.f - Quick Dialer using a Modem	5
Docu.f - Automatic "Documentation" Generator	6
DumpBrush.f - Dump a brush as JForth source code.	6
DumpIFF.f - Dump IFF file for analysis.	6
H2J.f - Convert a 'C' style ".h" file to a ".j" file.	6
Print.f - Print a File	6
Rude.f - Print Rude Message using an Alert	6
SortMerge.f - Merge Presorted Files	7
SayNumber.f - Recite a single-precision number in decimal	7
Terminal.f - Very Dumb Terminal Program	7
Update.f - Copy newer files from one directory to another	7
WordCount.f - Count Words Lines and Chars	7

E) Style Guidelines	8
Naming Conventions	8
Transportability Techniques	10
Multistandards	12

F) Words by Function	13

G) Incompatibilities	18
Between V2.0 and V3.0	18
Error Handling in IFF and Picture words.	18
Local Variables	18
Between V1.2 and V2.0	18
>BODY and BODY>	18
CONSOLE	19
Totally New Floating Point	19
Bugs Fixed	19
Signed AND Unsigned Structure Members	19

H) Products Written in JForth	20
B.A.D. from MV Micros	20
My Diary from MV Micros	20
HMSL, the Hierarchical Music Specification Language	20
Copyist Companion by Nick Didkovsky	20
Doctor Nerve with Nick Didkovsky	21
IntuiEZ by Curtis Stanton	21
XL by Martin Kees	21
JGoodies_1 from various.	21